import Vue from 'vue'
import Router from 'vue-router'
 import Home from '@/components/tabbar/Home.vue'
 import Member from '@/components/tabbar/Member.vue'
 import Search from '@/components/tabbar/Search.vue'
 import Shopcar from '@/components/tabbar/Shopcar.vue'
 import News from '@/components/news/News.vue'
 import NewsInfo from '@/components/news/NewsInfo.vue'
 import Photo from '@/components/photo/Photo.vue'
 import Photoinfo from '@/components/photo/Photoinfo.vue'
 import GoodsList from '@/components/goods/GoodsList.vue'
 import GoodsInfo from '@/components/goods/GoodsInfo.vue'
 import GoodsDesc from '@/components/goods/GoodsDesc.vue'
 import Goodscomment from '@/components/goods/Goodscomment.vue'
Vue.use(Router)

export default new Router({
  //设置被激活路由的自动添加类名
  linkActiveClass:'mui-active',
  routes: [
    //多级路由redirect 重定向
    {
      path: '/',
      redirect:'/home'
    },
    {
      path: '/home',
      name: 'Home',
      component: Home
    },
    {
      path: '/member',
      name: 'Member',
      component: Member
    },
    {
      path: '/search',
      name: 'Search',
      component: Search
    },
    {
      path: '/shopcar',
      name: 'Shopcar',
      component: Shopcar
    },
    {
      path: '/news',
      name: 'News',
      component: News
    },
    {
      path: '/home/newsinfo/:id',
      name: 'NewsInfo',
      component: NewsInfo
    },
    {
      path: '/photo',
      name: 'Photo',
      component: Photo
    },
    {
      path: '/home/photoinfo/:id',
      name: 'Photoinfo',
      component: Photoinfo
    },
    {
      path: '/goods',
      name: 'GoodsList',
      component: GoodsList
    },
    {
      path: '/home/goodsinfo/:id',
      name: 'GoodsInfo',
      component: GoodsInfo
    },
    { path: '/home/goodsdesc/:id',
     component:GoodsDesc, 
     name: 'goodsdesc' 
     },
     { path: '/home/goodscomment/:id',
     component:Goodscomment, 
     name: 'goodscomment' 
     },
  ]
})
